<template>
<view>
	<view class="header">客户分析</view>
	<view class="table">
		<table border="0" width="95%" cellspacing="0" cellpadding="0">
			<tr>
				<th class="td1">客户总数</th>
				<td>{{info.count}}</td>
			</tr>
			<tr v-for="(item,index) in info.arr" :key="index">
				<td>{{item.source}}</td>
				<td>{{item.total}}</td>
			</tr>
			<tr>
				<td>二次充值人数</td>
				<td>{{info.recharge}}</td>
			</tr>
			<tr>
				<td>二次购卡人数</td>
				<td>{{info.card}}</td>
			</tr>
			<tr>
				<td>二次耗卡人数</td>
				<td>{{info.mark}}</td>
			</tr>
			<tr>
				<td>二次购买人数</td>
				<td>{{info.order}}</td>
			</tr>
		</table>
	</view>
</view>
</template>
<script>
import request from '@/util/request.js'
export default {
	data() {
		return {
			//oaRole 1:店长2:员工3:商户
			info:{}
		}
	},
	onLoad:function(e){
		uni.showLoading({
		    title: '加载中'  
		});
		this.getCount();
	},
	methods: {
		getCount:function(){
			var data = {
				oa_id:uni.getStorageSync('oa_id')
			}
			var that = this
			request({
				url: 'manage/member/count',
				method: 'get',
				data:data,
				success: (res) => {
					uni.hideLoading();
					that.info = res.data.data
				},
			})
		}
	},
}
</script>
<style>
.header{
    width:100%;
    height:80rpx;
    line-height: 80rpx;
    text-align: center;
    background:#00b300;
    color:#fff;
}
.table{
	width:100%;
	padding:10rpx 20rpx 120rpx 20rpx;
}
table{
	margin-top:30rpx;
}
td{
	border:1rpx solid #C8C7CC;
	text-align: center;
	height:70rpx;
	line-height:70rpx;
}
th{
	border:1rpx solid #C8C7CC;
	text-align: center;
	height:70rpx;
	line-height:70rpx;
}
.td1{
	width:60%;
}
</style>